<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="../css/main1.css" />
<style>
.i_ml{background-image:url(../img/monitor.png)!important;}
.d_sx{background-image:url(../img/sucaiwcom52250hsz.png)!important;}
.d_note{background-image:url(../img/note.png)!important;}
</style>
<title>SevenEL@Prosperous</title>
<{$showjs}>
<script language="javascript">
function treeClick(node,e) {
	 if(node.isLeaf()){
		e.stopEvent();
		var n = center.getComponent(node.id);
		if (!n) {
			if(node.attributes.action){
			var n = center.add({
				'id' : node.id,
				'title' : node.text,
				closable:true,
				html:'<iframe scrolling="auto" frameborder="0" width="100%" height="100%" src="'+node.attributes.action+'"></iframe>'
				});
			}else{
				//alert(node.attributes.config);
				if(typeof(node.attributes.config)!='undefined'&&node.attributes.config!=''&&node.attributes.config!='{"lg":""}'){
					var n = center.add({
						'id' : node.id,
						'title' : node.text,
						closable:true,
						html:'<iframe scrolling="auto" frameborder="0" width="100%" height="100%" src="./dy/index.php?tid='+node.id+'"></iframe>'});}else{
						var n = center.add({
						'id' : node.id,
						'title' : node.text,
						closable:true,
						html:'<iframe scrolling="auto" frameborder="0" width="100%" height="100%" src="./show1/l.php?op=list&tid='+node.id+'"></iframe>'});
						}
			}
		}
		center.setActiveTab(n);
	 }
}
var	 center=new Ext.TabPanel({
		region:'center',
		id:'cms-center',
		defaults:{autoScroll: true},
		//defaults:{autoHeight: true},
		deferredRender:false,
		activeTab:0,
	    enableTabScroll:true,
		items:[
			new Ext.Panel({
				title:'说明',
				iconCls:'d_note',
				id:'wellcome',
				html:'<iframe scrolling="auto" frameborder="0" width="100%" height="100%" id="1" src="./instro.php"></iframe>'
			})
		],
		initEvents : function(){   
                Ext.TabPanel.superclass.initEvents.call(this);   
                this.on('add', this.onAdd, this, {target: this});   
                this.on('remove', this.onRemove, this, {target: this});   
                this.mon(this.strip, 'mousedown', this.onStripMouseDown, this);   
                this.mon(this.strip, 'contextmenu', this.onStripContextMenu, this);   
                if(this.enableTabScroll){   
                    this.mon(this.strip, 'mousewheel', this.onWheel, this);   
                }   
                this.mon(this.strip,'dblclick',this.onTitleDbClick,this);   
            },   
            onTitleDbClick:function(e,target,o){   
                var t = this.findTargets(e);   
				if(t.item.id!='wellcome'){
                if (t.item.fireEvent('beforeclose', t.item) !== false) {   
                            t.item.fireEvent('close', t.item);   
                            this.remove(t.item);                   
                       }   
				}
            }   

		});

var	 west=new Ext.Panel({
			region:'west',
			id:'west-panel',
			iconCls:'i_ml',
			split:true,
			width: 180,
			height:300,
			minSize: 175,
			maxSize: 400,
//			hidden:true,
			margins:'0 0 0 0',
			layout:'accordion',
			title:'文件目录',
			collapsible :true,
			layoutConfig:{
				animate:true
				},
			items: [
			{title:'文件列表',
					border:false,
					html:'<div id="r_tree1" style="width:100%;height:100%"></div>',
					iconCls:'d_sx',
					
							tools:[{
								id:'refresh',
								qtip: '刷新',
								handler:function(){
									var tree = Ext.getCmp('tree1');
									tree.body.mask('等待...','x-mask-loading');
									tree.root.reload();
									tree.root.collapse(true,true);
									setTimeout(function(){
								   	tree.body.unmask();
									},1000);
								}
							}]
			    }
			    ]
			});

Ext.onReady(function(){
   //layout
   var viewport = new Ext.Viewport({
		layout:'border',
		items:[
		west,
	    center
		 ]
	});
	var Tree = Ext.tree;
	var root1 = new Tree.AsyncTreeNode({
		text: '根',
		draggable:false,
		id:'1'
	});
	var tree = new Tree.TreePanel({
		id:'tree1',
		el:'r_tree1',
				autoScroll:true,
		root:root1,
		animate:true,
		height:Ext.get("r_tree1").getHeight(),
		enableDD:true,
		border:false,
		useArrows:true,
		rootVisible:false,
		containerScroll: true,
		loader: new Tree.TreeLoader({
			dataUrl:'./index.php',
			requestMethod:'POST',
			baseParams:{op:'loadfile',path}
			})
	});
	tree.setRootNode(root1);
	tree.render();
	//root<{$tree_config[li].id}>.expand();
	tree.on('click',treeClick);


	setTimeout(
				function() {
					Ext.get('loading').hide();
					Ext.get('loading-mask').fadeOut({hide:true});
				}, 250
			  );

	loadMask = new Ext.LoadMask(center.body,{msg:"页面加载中……"});
	loadMask.show();

	center.setActiveTab(120);
	loadMask.hide();
});
</script>
</head>
<body>
<div id="loading-mask" style=""></div>
			<div id="loading">
				<div class="loading-indicator"><img src="../img/extanim32.gif" width="32" height="32" style="margin-right:8px;" align="absmiddle"/>
					<a href="index.php">刷新</a>
					<span id="loading-msg">加载样式表和图片...</span>
				</div>
			</div>
</body>
</html>